package com.knowif.enumInfo;

/**
 * @author xingyao
 * @Description: 支付状态枚举
 */
public enum PayStateEnum {
	
	//成功
	SUCCESS(1),
	//失败
	FAULT(2),
	//支付中
	PAYING(3);
	
	private int state;
	
	private PayStateEnum(int state) {
		this.state = state;
	}

	public int getNumber() {
		return state;
	}
	
	
	/**
	 * @author: xingyao 
	 * @Description:  判断是否支付成功
	 * @param state
	 * @return
	 */
	public static boolean isSuccess(int state){
		if(state == SUCCESS.state){
			return true;
		}else{
			return false;
		}
	}
	
	
	/**
	 * @author: xingyao 
	 * @Description:  判断是否支付失败
	 * @param state
	 * @return
	 */
	public static boolean isFault(int state){
		if(state == FAULT.state){
			return true;
		}else{
			return false;
		}
	}
	
	/**
	 * @author: xingyao 
	 * @Description: 判断是否正在支付中
	 * @param state
	 * @return
	 */
	public static boolean isPaying(int state){
		if(state == PAYING.state){
			return true;
		}else{
			return false;
		}
	}
	
	
	

}
